import math
import itertools
from pylab import *
import matplotlib.lines as mlines

namesimu='E5U20W2.0'
cuales=['0.05','0.1','0.2','0.5','1','2','5','10','20','40','60','100','200']
cuales=['1','5','10','20','40','60','100']
#cuales=['0.05']
dir='/home/jcfernandez/resultados/eps5/u0/AMPL/W2.0/CONNECT/TOTAL/'
dir='/Users/jonk/Documents/Trabajo/resultados/eps1/u0/AMPL/W2.0/CONNECT/NEO/'
colors = itertools.cycle(['b', 'g', 'r', 'c', 'm', 'y', 'k'])
grp=[]
for j in range(len(cuales)):
    name='dis-nconnectA'+cuales[j]+'.dat'
#    name='densidadconnectA'+cuales[j]+'.dat'
    x=[]
    y=[]
    erry=[]
    color = colors.next()
    for line in file(dir+name):
        line=line.replace('\n','')
        val=line.split(' ')
        res=[]
        for v in val:
            if v!='':
                res.append(float(v))

        x.append(res[0])
        y.append(res[1])
        erry.append(res[2])
        #plot(x,y,'ro')
#    errorbar(x, y, yerr=erry,linestyle='-')#, c=color,fmt='o-')
    #I1=errorbar(x, y, yerr=erry)
    plot(x,y,c=color,marker='o')
    #grp.append(I1)
    #plot(x, y)

xlabel(r'$\theta $',fontsize=20)
ylabel(r'Conectividad',fontsize=14)
legend(tuple(cuales), shadow = True, loc = (0.9, 0.3))
title(namesimu)
savefig(dir+namesimu+'.png', format='png')
show()